$(document).ready(function()
{
	/**
	* 根据数据值显示省市值
	*/
	var pc=$('td[name="ProvinceCity"]');	
	pc.each(function($index,$element)
	{
		var tmp=$element.innerText.split('-');
		var provinceValue=tmp[0],cityValue=tmp[1];		
		try
		{
			var text='';
			text=$.DATA_PROVINCE_CITY[provinceValue].n
			if($.DATA_PROVINCE_CITY[provinceValue].c[cityValue])
			{
				text=text+'-'+$.DATA_PROVINCE_CITY[provinceValue].c[cityValue];
			}
			else
			{
				text=text+'-'+cityValue;
			}			
			$element.innerText=text;			
		}
		catch(e)
		{
			$element.innerText=cityValue;
		}
	});
	
	/**
	* 初始化搜索区域
	*/
	$.initProv("#Shipyard_Index_Province","#Shipyard_Index_City");	
	var search_province=$('#Shipyard_Index_Province');
	var search_city=$('#Shipyard_Index_City');
	var search_model=$('#Shipyard_Index_Model');	
	var search_companyName=$('#Shipyard_Index_CompanyName');
	var search_button=$('#Shipyard_Index_Button');		
	search_button.click(function()
	{
		if(search_province.val()=='-1'&&search_city.val()=='-1'&&search_model.val()=='-1'&&search_companyName.val()=='')
		{
			
			search_province.focus();
			return false;
		}
		
		var location='/exec.php?action=shipyard_account_list&type=search';
		{
			if(search_province.val()!='-1'){
				location=location+'&province='+search_province.val();
			}
			if(search_city.val()!='-1'){
				location=location+'&city='+search_city.val();				
			}
			if(search_model.val()!='-1'){
				location=location+'&model='+search_model.val();				
			}
			if(search_companyName.val()!=''){
				location=location+'&companyname='+encodeURI(search_companyName.val());
			}			
		}		
		window.location=location;
		return false;
	});	
});















